package com.demo.controller;


import java.util.List;

import com.demo.entity.po.AssessmentInfo;

import com.demo.entity.query.AssessmentInfoQuery;

import com.demo.entity.vo.PaginationResultVO;

import com.demo.entity.vo.ResponseVO;

 import org.springframework.web.bind.annotation.RequestBody;

import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import com.demo.service.AssessmentInfoService;

/**
 * @Description:心理自评结果表Controller
 * @Date:2025-03-01
 * @author：author
*/
@RestController
@RequestMapping("/assessmentInfo")
public class AssessmentInfoController extends ABaseController {

	@Resource
	private AssessmentInfoService assessmentInfoService;

	/**
	 * 分页查询
	 */
	@RequestMapping("/loadDataList")
	public ResponseVO loadDataList(AssessmentInfoQuery query) {
		return getSuccessResponseVO(assessmentInfoService.findListByPage(query));
	}
	/**
	 * 新增
	 */
	@RequestMapping("/add")
	public ResponseVO add(AssessmentInfo bean) { 
		this.assessmentInfoService.add(bean);
		return getSuccessResponseVO(null);	}

	/**
	 * 批量新增
	 */
	@RequestMapping("/addBatch")
	public ResponseVO addBatch(@RequestBody List<AssessmentInfo> listBean) { 
		this.assessmentInfoService.addBatch(listBean);
		return getSuccessResponseVO(null);
	}

	@RequestMapping("/addOrUpdateBatch")
	/**
	 * 批量新增或者修改
	 */
	public ResponseVO addOrUpdateBatch(@RequestBody List<AssessmentInfo> listBean) { 
		this.assessmentInfoService.addOrUpdateBatch(listBean);
		return getSuccessResponseVO(null);
	}

	/**
	 * 根据AssessmentId查询
	 */
	@RequestMapping("/getAssessmentInfoByAssessmentId")
	public  ResponseVO getAssessmentInfoByAssessmentId(Long assessmentId) { 
		return getSuccessResponseVO(this.assessmentInfoService.getAssessmentInfoByAssessmentId(assessmentId));
	}

	/**
	 * 根据AssessmentId更新
	 */
	@RequestMapping("/updateAssessmentInfoByAssessmentId")
	public ResponseVO updateAssessmentInfoByAssessmentId(AssessmentInfo bean, Long assessmentId) { 
		this.assessmentInfoService.updateAssessmentInfoByAssessmentId(bean,assessmentId);
		return getSuccessResponseVO(null);
	}

	/**
	 * 根据AssessmentId删除
	 */
	@RequestMapping("/deleteAssessmentInfoByAssessmentId")
	public ResponseVO deleteAssessmentInfoByAssessmentId(Long assessmentId) { 
		this.assessmentInfoService.deleteAssessmentInfoByAssessmentId(assessmentId);
		return getSuccessResponseVO(null);
	}
}